<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/hlht/detailHlhtDiscount.js"></script>
    <link href="${ctx}/statics/css/plugins/steps/jquery.steps.css" rel="stylesheet">
    <script type="text/javascript" src="${ctx}/libjs/plugins/steps/jquery.steps.min.js"></script>
    <style>
        .wizard-big.wizard > .content {
            min-height: 600px;
        }

        .wizard > .content > .body {
            padding-top: 1%;
        }

        .form-group {
            margin-top: 1rem;
        }

        input[type=checkbox], input[type=radio] {
            display: inline-block;
            width: 15px;
            height: 15px;
            vertical-align: text-bottom;
            margin-right: 10px;
        }

        .inlineBlock {
            display: inline-block !important;
        }

        #beginTime, #endTime {
            width: 35%;
        }

        .wizard > .content > .body label.error {
            margin: 0 1rem 0 0;
        }

        .width20 {
            width: 20% !important;
        }

        .titleFont {
            font-size: 14px;
            font-weight: 700;
        }

        .width20 {
            width: 20%;
        }

        .width10 {
            width: 10%;
        }

        .ml10 {
            margin-left: 10px;
        }

        .mt10 {
            margin-top: 10px;
        }

        .width8 {
            width: 8%;
        }

        .width170 {
            width: 170px;
        }

        .mlr {
            margin: 0 10px;
        }

        .btn {
            color: #fff !important;
        }

        .hide {
            display: none;
        }
        #beginTime, #endTime{
            width: auto;
        }
        #beginTime-error{
            display: none;
        }
        .form-group{
            /*display: block;*/
            margin-top: 20px !important;
        }

        /*#beginTime,#endTime{*/
        /*background-color: #fff !important;*/
        /*}*/
    </style>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return'<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>设备管理</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>查看优惠方案</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

</script>

<body class="gray-bg">



<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <input id="discountPolicyId" name="discountPolicyId" type="hidden"
                       value="${tenantDiscountPolicy.discountPolicyId}">
                <div class="ibox-title">
                    <div class="columns pull-left">
                        <h5 class="font-bold">查看优惠方案</h5>
                    </div>
                    <div class="ibox-tools">
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>


                <div class="ibox-content">
                    <form id="form" action="#" class="wizard-big">
                        <h1>方案</h1>
                        <fieldset>
                            <%--<h2>查看方案</h2>--%>
                            <div class="row">

                                <input id="elecStationId" name="elecStationId"
                                       value="${tenantDiscountPolicy.elecStationId}" type="hidden">
                                <div class="col-lg-8">
                                    <div class="form-group">
                                        <label class="col-sm-2">互联运营商名称 *</label>
                                        <input id="" name="policyName" type="text" autocomplete="off" disabled
                                               value="${tenantDiscountPolicy.policyName}"
                                               class="form-control col-sm-6" placeholder="请输入优惠政策名称">
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2">折扣类型 *</label>
                                            <div class="col-sm-2 inlineBlock">
                                                <input name="discountType" type="radio" checked value="0" disabled
                                                       autocomplete="off"
                                                       <c:if test="${tenantDiscountPolicy.discountType eq '0'}">checked</c:if>
                                                       class="form-control inlineBlock">服务费打折
                                            </div>
                                            <%--<div class="col-sm-3 inlineBlock">--%>
                                                <%--<input name="discountType" type="radio" value="1" autocomplete="off" disabled--%>
                                                       <%--<c:if test="${tenantDiscountPolicy.discountType eq '1'}">checked</c:if>--%>
                                                       <%--class="form-control  inlineBlock">特定服务费(活动价)--%>
                                                <%--&lt;%&ndash;<input name="discountType" type="radio" checked class="form-control inlineBlock">特定价格&ndash;%&gt;--%>
                                            <%--</div>--%>
                                    </div>
                                    <%--<div class="form-group">--%>
                                    <%--<label>优惠政策说明</label>--%>
                                    <%--<input id="" name="policyDesc" type="text" autocomplete="off"--%>
                                    <%--class="form-control " placeholder="请输入优惠政策说明">--%>
                                    <%--</div>--%>
                                    <%--<div class="form-group">--%>
                                    <%--<label>打折类型下的折扣率% *</label>--%>
                                    <%--<input id="discount" name="discount" type="text" class="form-control " autocomplete="off"--%>
                                    <%--placeholder="请输入折扣率">--%>
                                    <%--</div>--%>
                                    <div class="form-group">
                                        <label class="col-sm-2">折扣时间 *</label>
                                        <div>
                                            <input id="beginTime" name="beginTime" type="text" autocomplete="off"
                                                   readonly disabled
                                                   value="<fmt:formatDate value="${tenantDiscountPolicy.beginTime}" pattern="yyyy-MM-dd HH:mm:ss" />"
                                                   class="form-control col-sm-6  inlineBlock" autocomplete="off"
                                                   placeholder="请选择开始时间">
                                            <span>--</span>
                                            <input id="endTime" name="endTime" type="text" autocomplete="off" readonly disabled
                                                   value="<fmt:formatDate value="${tenantDiscountPolicy.endTime}" pattern="yyyy-MM-dd HH:mm:ss" />"
                                                   class="form-control col-sm-6 inlineBlock" autocomplete="off"
                                                   placeholder="请选择结束时间">
                                        </div>
                                    </div>
                                    <%--<div class="col-lg-4">--%>
                                    <%--<div class="text-center">--%>
                                    <%--<div style="margin-top: 20px">--%>
                                    <%--<i class="fa fa-sign-in"--%>
                                    <%--style="font-size: 180px;color: #e5e5e5 "></i>--%>
                                    <%--</div>--%>
                                    <%--</div>--%>
                                    <%--</div>--%>
                                </div>
                            </div>
                        </fieldset>
                        <h1>时段</h1>
                        <fieldset>
                            <div class="typeBox1 <c:if test="${tenantDiscountPolicy.discountType eq '1'}">hide</c:if>">
                                <%--<h2 class="col-sm-2">查看时段价格</h2>--%>
                                <div class="row">
                                    <div class="col-lg-12">
                                        <div class="form-group disCountTypeBox1" style="display: block">
                                            <input type="radio" value="1" name="D_timeType" disabled
                                                   <c:if test="${tenantDiscountPolicy.timeType eq '0'}">checked</c:if>
                                                   class="inlineBlock firstRadio"><label
                                                class="titleFont">采用全天标准折扣（0~1）</label>
                                            <%--<c:forEach items="${tenantDiscountPolicy.tenantDiscountTimeList}" var="bean" varStatus="index" >--%>
                                            <c:if test="${tenantDiscountPolicy.timeType eq '0'}">
                                                <c:forEach items="${tenantDiscountPolicy.tenantDiscountTimeList}"
                                                           var="bean" varStatus="index" end="0">
                                                    <div class="typeOneBox <c:if test="${tenantDiscountPolicy.timeType eq '1'}">hide</c:if>">
                                                        <span style="margin-left: 30px">服务费折扣*</span>
                                                        <input id="D_discount0" name="discount0" type="text" disabled
                                                               value="${bean.discount}"
                                                               class="form-control inlineBlock width170" required
                                                               autocomplete="off" placeholder="请输入服务费折扣">
                                                    </div>
                                                </c:forEach>
                                            </c:if>
                                            <c:if test="${tenantDiscountPolicy.timeType eq '1'}">
                                                <div class="typeOneBox <c:if test="${tenantDiscountPolicy.timeType eq '1'}">hide</c:if>">
                                                    <span style="margin-left: 30px">服务费折扣*</span>
                                                    <input id="D_discount0" name="discount0" type="text" disabled
                                                           value=""
                                                           class="form-control inlineBlock width170" required
                                                           autocomplete="off" placeholder="请输入服务费折扣">
                                                </div>
                                            </c:if>
                                        </div>

                                        <div class="form-group timeForm1" style="display: block">
                                            <div>
                                                <input type="radio" value="2" name="D_timeType" disabled
                                                       <c:if test="${tenantDiscountPolicy.timeType eq '1'}">checked</c:if>
                                                       class="inlineBlock secondRadio"><label
                                                    class="titleFont">采用分时段折扣设置（需覆盖全部时段）（0~1）</label>
                                            </div>
                                            <c:if test="${tenantDiscountPolicy.timeType eq '1'}">
                                                <c:forEach items="${tenantDiscountPolicy.tenantDiscountTimeList}"
                                                           var="bean" varStatus="index">
                                                    <div name="VIPQuantuan"
                                                         class="mt10 <c:if test="${tenantDiscountPolicy.timeType eq '0'}">hide</c:if>">
                                                        <label class="ml10" style="margin-left: 30px">时段${index.index+1}:</label>
                                                        <input id="D_startPeriod${index.index+1}" name="startPeriods"
                                                               type="text" disabled
                                                               autocomplete="off"
                                                               value="<fmt:formatDate value="${bean.beginTime}" pattern="HH:mm:ss" />"
                                                               class="form-control ml10 inlineBlock width10" required
                                                               placeholder="开始时间">
                                                        <span class="mlr">--</span>
                                                        <input id="D_endPeriod${index.index+1}" name="endPeriods" disabled
                                                               type="text" required
                                                               autocomplete="off"
                                                               value="<fmt:formatDate value="${bean.endTime}" pattern="HH:mm:ss" />"
                                                               class="form-control inlineBlock width10"
                                                               placeholder="结束时间">
                                                        <span class="ml10">服务费折扣*</span>
                                                        <input id="D_discounts${index.index+1}" name="discounts" disabled
                                                               type="text" required
                                                               autocomplete="off" value="${bean.discount}"
                                                               class="form-control inlineBlock width8" placeholder="">
                                                        <c:if test="${index.index==0}">
                                                            <a class="btn btn-primary btn-sm addPeriod"
                                                               style="margin-left: 30px;margin-top: 3px">新增时段</a>
                                                        </c:if>
                                                        <c:if test="${index.index!=0}">
                                                            <a class="btn btn-danger btn-sm delTime_btn"
                                                               style="margin-left: 30px;margin-top: 3px">删除时段</a>
                                                        </c:if>
                                                    </div>
                                                </c:forEach>
                                            </c:if>
                                            <c:if test="${tenantDiscountPolicy.timeType eq '0'}">
                                                <div name="VIPQuantuan"
                                                     class="mt10 <c:if test="${tenantDiscountPolicy.timeType eq '0'}">hide</c:if>">
                                                    <label class="ml10" style="margin-left: 30px">时段1:</label>
                                                    <input id="D_startPeriod1" name="startPeriods" type="text"
                                                           autocomplete="off" value="" disabled
                                                           class="form-control ml10 inlineBlock width10" required
                                                           placeholder="开始时间">
                                                    <span class="mlr">--</span>
                                                    <input id="D_endPeriod1" name="endPeriods" type="text" required
                                                           autocomplete="off" value="" disabled
                                                           class="form-control inlineBlock width10" placeholder="结束时间">
                                                    <span class="ml10">服务费折扣*</span>
                                                    <input id="D_discounts1" name="discounts" type="text" required disabled
                                                           autocomplete="off" value=""
                                                           class="form-control inlineBlock width8" placeholder="">
                                                    <a class="btn btn-primary btn-sm addPeriod"
                                                       style="margin-left: 30px;margin-top: 3px">新增时段</a>

                                                </div>
                                            </c:if>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <%--<c:if test="${tenantDiscountPolicy.discountType eq '1'}">--%>
                            <div class="typeBox2 <c:if test="${tenantDiscountPolicy.discountType eq '0'}">hide</c:if>">
                                <%--<h2>查看时段价格</h2>--%>
                                <div class="row">
                                    <div class="col-lg-12">
                                        <div class="form-group disCountTypeBox1" style="display: block">
                                            <input type="radio" value="1" name="timeType" disabled
                                                   <c:if test="${tenantDiscountPolicy.timeType eq '0'}">checked</c:if>
                                                   class="inlineBlock firstRadio"><label
                                                class="titleFont">采用全天标准优惠价</label>
                                            <c:if test="${tenantDiscountPolicy.timeType eq '0'}">
                                                <c:forEach items="${tenantDiscountPolicy.tenantDiscountTimeList}"
                                                           var="bean" varStatus="index" end="0">
                                                    <div class="typeTwoBox <c:if test="${tenantDiscountPolicy.timeType eq '1'}">hide</c:if>">
                                                        <span style="margin-left: 30px">电费优惠价</span>
                                                        <input id="" name="elecPrice0" type="text" required disabled
                                                               value="${bean.elecPrice}"
                                                               class="form-control inlineBlock width20"
                                                               autocomplete="off"
                                                               placeholder="请输入电费优惠价">
                                                        <span class="ml-2">服务费优惠价</span>
                                                        <input id="" name="servicePrice0" type="text" required disabled
                                                               value="${bean.servicePrice}"
                                                               class="form-control inlineBlock width20"
                                                               autocomplete="off"
                                                               placeholder="请输入服务优惠价">
                                                    </div>
                                                </c:forEach>
                                            </c:if>
                                            <c:if test="${tenantDiscountPolicy.timeType eq '1'}">
                                                <div class="typeTwoBox <c:if test="${tenantDiscountPolicy.timeType eq '1'}">hide</c:if>">
                                                    <span style="margin-left: 30px">电费优惠价</span>
                                                    <input id="" name="elecPrice0" type="text" required value="" disabled
                                                           class="form-control inlineBlock width20" autocomplete="off"
                                                           placeholder="请输入电费优惠价">
                                                    <span class="ml-2">服务费优惠价</span>
                                                    <input id="" name="servicePrice0" type="text" required value="" disabled
                                                           class="form-control inlineBlock width20" autocomplete="off"
                                                           placeholder="请输入服务优惠价">
                                                </div>
                                            </c:if>
                                        </div>

                                        <div class="form-group timeForm1" id="timeForm" style="display: block">
                                            <div>
                                                <input type="radio" value="2" name="timeType" disabled
                                                       <c:if test="${tenantDiscountPolicy.timeType eq '1'}">checked</c:if>
                                                       class="inlineBlock secondRadio"><label
                                                    class="titleFont">采用分时段折扣设置（需覆盖全部时段）</label>
                                            </div>
                                            <c:if test="${tenantDiscountPolicy.timeType eq '1'}">
                                                <c:forEach items="${tenantDiscountPolicy.tenantDiscountTimeList}"
                                                           var="bean" varStatus="index">
                                                    <div name="VIPQuantuan"
                                                         class="mt10 <c:if test="${tenantDiscountPolicy.timeType eq '0'}">hide</c:if>">
                                                        <label class="ml10" style="margin-left: 30px">时段1:</label>
                                                        <input id="startPeriod${index.index+1}" name="startPeriod" disabled
                                                               type="text"
                                                               autocomplete="off" required
                                                               value="<fmt:formatDate value="${bean.beginTime}" pattern="HH:mm:ss" />"
                                                               class="form-control ml10 inlineBlock width10"
                                                               placeholder="开始时间">
                                                        <span class="mlr">--</span>
                                                        <input id="endPeriod${index.index+1}" name="endPeriod" disabled
                                                               type="text"
                                                               autocomplete="off" required
                                                               value="<fmt:formatDate value="${bean.endTime}" pattern="HH:mm:ss" />"
                                                               class="form-control inlineBlock width10"
                                                               placeholder="结束时间">
                                                        <span class="ml10">电费优惠价*</span>
                                                        <input id="elecPrice${index.index+1}" name="elecPrice" disabled
                                                               type="text"
                                                               autocomplete="off" required value="${bean.elecPrice}"
                                                               class="form-control inlineBlock width8" placeholder="">
                                                        <span class="ml10">服务费优惠价*</span>
                                                        <input id="servicePrice${index.index+1}" name="servicePrice" disabled
                                                               type="text"
                                                               autocomplete="off" required value="${bean.servicePrice}"
                                                               class="form-control inlineBlock width8" placeholder="">
                                                        <c:if test="${index.index==0}">
                                                            <a class="btn btn-primary btn-sm addPeriod"
                                                               style="margin-left: 30px;margin-top: 3px">新增时段</a>
                                                        </c:if>
                                                        <c:if test="${index.index!=0}">
                                                            <a class="btn btn-danger btn-sm delTime_btn"
                                                               style="margin-left: 30px;margin-top: 3px">删除时段</a>
                                                        </c:if>
                                                    </div>
                                                </c:forEach>
                                            </c:if>
                                            <c:if test="${tenantDiscountPolicy.timeType eq '0'}">
                                                <div name="VIPQuantuan"
                                                     class="mt10 <c:if test="${tenantDiscountPolicy.timeType eq '0'}">hide</c:if>">
                                                    <label class="ml10" style="margin-left: 30px">时段1:</label>
                                                    <input id="startPeriod1" name="startPeriod" type="text" disabled
                                                           autocomplete="off" required value=""
                                                           class="form-control ml10 inlineBlock width10"
                                                           placeholder="开始时间">
                                                    <span class="mlr">--</span>
                                                    <input id="endPeriod1" name="endPeriod" type="text" disabled
                                                           autocomplete="off" required value=""
                                                           class="form-control inlineBlock width10" placeholder="结束时间">
                                                    <span class="ml10">电费优惠价*</span>
                                                    <input id="elecPrice1" name="elecPrice" type="text" disabled
                                                           autocomplete="off" required value=""
                                                           class="form-control inlineBlock width8" placeholder="">
                                                    <span class="ml10">服务费优惠价*</span>
                                                    <input id="servicePrice1" name="servicePrice" type="text" disabled
                                                           autocomplete="off" required value=""
                                                           class="form-control inlineBlock width8" placeholder="">
                                                    <a class="btn btn-primary btn-sm addPeriod"
                                                       style="margin-left: 30px;margin-top: 3px">新增时段</a>


                                                </div>
                                            </c:if>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <%--</c:if>--%>
                        </fieldset>
                        <h1>用户</h1>
                        <fieldset>
                            <div class="mt10 ml10">
                                <input name="memberType" type="radio" value="0" checked disabled
                                       <c:if test="${tenantDiscountPolicy.policyMemberType eq '0'}">checked</c:if>
                                       class="required inlineBlock">全部用户
                            </div>
                            <div class="mt10 ml10">
                                <input name="memberType" type="radio" value="1" disabled
                                       <c:if test="${tenantDiscountPolicy.policyMemberType eq '1'}">checked</c:if>
                                       class="required inlineBlock">指定用户（可批量录入）
                            </div>
                            <div class="mobileBox hide"><c:forEach items="${tenantDiscountPolicy.tenantDiscountMemberList}" var="bean">${bean.mobile},</c:forEach></div>
                            <div class="mt10 ml10 <c:if test="${tenantDiscountPolicy.policyMemberType eq '0'}">hide</c:if>"
                                 id="inputBox">
                                <textarea rows="8" cols="60" id="mobileArea" disabled></textarea>
                                <p class="mt10" style="font-size: 12px">tips: 批量录入规则：必须换行输入。可提前在编辑器编辑好，方便复制粘贴。</p>
                            </div>
                            <%--<label for="acceptTerms">我同意条款和条件。</label>--%>
                        </fieldset>

                    </form>

                </div>

            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="${ctx}/appjs/discount/detailDiscount.js"></script>
<script>
    // 手机号码
    var mobileStr = $(".mobileBox").html();
    var str = mobileStr.replace(/,/g,"\n");
    $("#mobileArea").html(str);
</script>
</html>
